﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Runtime.Serialization;

namespace dasBlog.Storage
{
    public interface IStorageProvider<T> 
    {
        Moniker Store(Moniker moniker, T item);
        void Delete(Moniker itemId);
        T Get(Moniker itemId);
        IEnumerable<T> Select(Moniker moniker, MonikerMatch contextMatch, QueryDescription query);
        IEnumerable<PropertyAggregate> Aggregate(Moniker moniker, MonikerMatch contextMatch, string propertyName);
    }

    [DataContract]
    public class PropertyAggregate
    {
        [DataMember]
        public string Value { get; set; }
        [DataMember]
        public int Count { get; set; }
    }

    public interface IInitStorageProvider
    {
        void Initialize(string initData);
    }

    

}
